package response

import "github.com/gin-gonic/gin"

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func Success(data interface{}) gin.H {
	return gin.H{
		"code":    200,
		"message": "success",
		"data":    data,
	}
}

func Error(code int, message string) gin.H {
	return gin.H{
		"code":    code,
		"message": message,
		"data":    nil,
	}
}
